package cn.net.isir.controller.common;

import cn.net.isir.service.UserRoleService;
import cn.net.isir.service.UserService;
import cn.net.isir.service2.*;
import cn.net.isir.dao.PermissionDao;
import cn.net.isir.dao.RoleDao;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author liuxubo
 * @filename TestController.java
 * @package cn.net.isir.controller
 * @email lxb@isir.net.cn
 * @date 2018/11/09
 * @comment
 * @since 1.8
 */
@Controller
@RequestMapping("/minip/test")
public class MiniTestController {
    // 声明log4j日志
    private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(MiniTestController.class);
    @Resource
    private UserService userService;
    @Resource
    private TableService tableService;
    @Resource
    private PermissionDao permissionDao;
    @Resource
    private RoleDao roleDao;
    @Resource
    private TestService testService;
    @Resource
    private UserRoleService userRoleService;
    @Resource
    private ShopService shopService;
    @Resource
    private FinanceStatisticsService financeStatisticsService;

    @RequestMapping(method = RequestMethod.GET, value = "/i")
    public String test(HttpServletRequest request, HttpServletResponse response) {
        Cookie[] cookies = request.getCookies();
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                //http://127.0.0.1:8080/login.html;jsessionid=6F6D1F4B691139F0ECE05F1D8A6FE582
                logger.info("------------------------------------");
                logger.info(cookie.getName());
                logger.info(cookie.getValue());
            }
        }
        return "test";
    }
}
